

<template>
  <div>
    <z-space vertical>
      <h3>日历</h3>

<!--      <div>-->
<!--        <el-button @click="setHolidays">设置节假日</el-button>-->
<!--      </div>-->

      <z-calendar :events="events"
      @calendar-edit="onTest"
      ></z-calendar>

    </z-space>
  </div>
</template>

<script>
import DocProps from "@example/plugins/example/components/DocProps";
// import ZCalendar from "@/zpkgs/components/z-calendar/ZCalendar";

// console.log(calendar.solar2lunar(1987,11,1))

let events = [

]


export default {
  components: {DocProps},
  data() {
    return {
      events,
      doc: {
        props: [
          {
            name: 'def',
            type: 'Object',
            defVal: '{columns: [], records: []}',
            desc: '定义'
          }
        ]
      },
    }
  },
  mounted() {
    // this.setHolidays()
    this.setDemo()
  },
  methods: {
    onTest(e) {
      console.log('onTest', e)
    },
    setDemo() {
      this.events = this.events.concat([
        {
          date: '2022-06-24',
          detail: '项目发布研讨',
          type: 'done'
        },
        {
          date: '2022-06-27',
          detail: '项目发布研讨',
          type: 'done'
        },
        {
          date: '2022-06-27',
          detail: '项目发布研讨',
          type: 'fail'
        },
        {
          date: '2022-06-27',
          detail: '项目发布研讨',
          type: 'going'
        }
      ])
    },
    setHolidays() {
      this.events = [].concat([
        {
          date: '2022-01-01',
          detail: '元旦',
        },
        {
          date: '2022-01-02',
          detail: '元旦',
        },
        {
          date: '2022-01-29',
          detail: '调休',
          type: 'warning'
        },
        {
          date: '2022-01-30',
          detail: '调休',
          type: 'warning'
        },
        {
          date: '2022-01-03',
          detail: '元旦',
        },
        {
          date: '2022-01-31',
          detail: '春节',
        },
        {
          date: '2022-02-01',
          detail: '春节',
        },
        {
          date: '2022-02-02',
          detail: '春节',
        },
        {
          date: '2022-02-03',
          detail: '春节',
        },
        {
          date: '2022-02-04',
          detail: '春节',
        },
        {
          date: '2022-02-05',
          detail: '春节',
        },
        {
          date: '2022-02-06',
          detail: '春节',
        },
        {
          date: '2022-04-02',
          detail: '调休',
          type: 'warning'
        },
        {
          date: '2022-04-03',
          detail: '清明节',
        },
        {
          date: '2022-04-04',
          detail: '清明节',
        },
        {
          date: '2022-04-05',
          detail: '清明节',
        },
        {
          date: '2022-04-24',
          detail: '调休',
          type: 'warning'
        },
        {
          date: '2022-05-07',
          detail: '调休',
          type: 'warning'
        },
        {
          date: '2022-04-30',
          detail: '劳动节',
        },
        {
          date: '2022-05-01',
          detail: '劳动节',
        },
        {
          date: '2022-05-02',
          detail: '劳动节',
        },
        {
          date: '2022-05-03',
          detail: '劳动节',
        },
        {
          date: '2022-05-04',
          detail: '劳动节',
        },
        {
          date: '2022-06-03',
          detail: '端午节',
        },
        {
          date: '2022-06-04',
          detail: '端午节',
        },
        {
          date: '2022-06-05',
          detail: '端午节',
        },
        {
          date: '2022-09-10',
          detail: '中秋节',
        },
        {
          date: '2022-09-11',
          detail: '中秋节',
        },
        {
          date: '2022-09-12',
          detail: '中秋节',
        },
        {
          date: '2022-10-01',
          detail: '国庆节',
        },
        {
          date: '2022-10-02',
          detail: '国庆节',
        },
        {
          date: '2022-10-03',
          detail: '国庆节',
        },
        {
          date: '2022-10-04',
          detail: '国庆节',
        },
        {
          date: '2022-10-05',
          detail: '国庆节',
        },
        {
          date: '2022-10-06',
          detail: '国庆节',
        },
        {
          date: '2022-10-07',
          detail: '国庆节',
        },
        {
          date: '2022-10-08',
          detail: '调休',
          type: 'warning'
        },
        {
          date: '2022-10-09',
          detail: '调休',
          type: 'warning'
        },
      ])
    }
  }
}
</script>
